
# Contributor: 3ED <krzysztof1987 at gmail dot com>

pkgname=perl-file-readbackwards
_lastauthor=P/PL/PLICEASE
_pkgname=File-ReadBackwards
pkgver=1.06
pkgrel=4
pkgdesc="read a file backwards by lines"
arch=('any')
license=('PerlArtistic' 'GPL')
options=('!emptydirs')
depends=('perl')
makedepends=('perl-extutils-makemaker')
url="https://search.cpan.org/dist/${_pkgname}/"
source=(https://search.cpan.org/CPAN/authors/id/${_lastauthor}/${_pkgname}-${pkgver}.tar.gz)
sha512sums=('43b7ebe58728272fbc0518fe6572b31061ba09665443240558b9035573d075c28b52d6230078f24616110d54e51477ad122c985d4fcdb3c3d288cb24e476fe45')

build() {
  cd ${_pkgname}-${pkgver}

  export PERL_MM_USE_DEFAULT=1 PERL_AUTOINSTALL="--skipdeps" \
    PERL_MM_OPT="INSTALLDIRS=vendor DESTDIR='$pkgdir'" \
    PERL_MB_OPT="--installdirs vendor --destdir '$pkgdir'" \
    MODULEBUILDRC=/dev/null

  perl Makefile.PL
  make
}
check() {
  cd ${_pkgname}-${pkgver}
  make test
}
package() {
  cd ${_pkgname}-${pkgver}
  make install
}
